import { makeAutoObservable } from 'mobx';

function createDoubler(value: number) {
  return makeAutoObservable({
    value,
    get double() {
      return value * 2;
    },
    increment() {
      value++;
    },
  });
}

export default createDoubler;
